package com.zwt.constant;

/**
 * Created by zwt on 2018/9/5.
 * redis中所有key的获取规则
 */
public class RedisKeyUtil {

    /**
     * 根据用户主键获取用户缓存key
     * @param id
     * @return
     */
    public static String getUserCache(Long id){
        return RedisConstant.USER_KEY+id;
    }

    /**
     * 根据手机号获取注册验证码key
     * @param phone
     * @return
     */
    public static String getRegCache(String phone){
        return RedisConstant.REG_KEY+phone;
    }

    /**
     * 根据手机号获取登录验证码key
     * @param phone
     * @return
     */
    public static String getLoginCache(String phone){
        return RedisConstant.LOGIN_KEY+phone;
    }


}
